package cn.edu.scau.cmi.wujiaxian.exercise10;

import java.io.File;
import java.io.IOException;

public class Example10_1 {
	
	public static void main(String[] args) {
		File file = new File(
				"C:\\Users\\lenovo\\git\\201734020124_wu_jiaxian\\201734020124吴嘉贤\\src\\cn\\edu\\scau\\cmi\\wujiaxian\\exercise10", 
						"Example10_1.java");
		System.out.println(file.getName());
		System.out.println(file.canRead());
		System.out.println(file.length());
		System.out.println(file.getAbsolutePath());
		System.out.println(file.canWrite());
		File file2 = new File("new.txt");
		System.out.println(file2.getAbsolutePath());
		if (!file2.exists()) {
			try {
				file2.createNewFile();
				System.out.println(file2.getAbsolutePath());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
	
}
